From 0e0f39af2e6585d7b61cf67652cdc0c2b2f06eb8 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Wed, 18 Jan 2023 19:44:27 -0800 Subject: pots --- src/routes/(app)/invoice/[id]/+layout.server.js | 19 -- src/routes/(app)/invoice/[id]/+layout.svelte | 1 - src/routes/(app)/invoice/[id]/+page.server.js | 5 - src/routes/(app)/invoice/[id]/+page.svelte | 158 -------------- src/routes/(app)/invoice/[id]/paid/+page.svelte | 62 ------ src/routes/(app)/invoice/[id]/tip/+page.server.js | 11 - src/routes/(app)/invoice/[id]/tip/+page.svelte | 252 ---------------------- 7 files changed, 508 deletions(-) delete mode 100644 src/routes/(app)/invoice/[id]/+layout.server.js delete mode 100644 src/routes/(app)/invoice/[id]/+layout.svelte delete mode 100644 src/routes/(app)/invoice/[id]/+page.server.js delete mode 100644 src/routes/(app)/invoice/[id]/+page.svelte delete mode 100644 src/routes/(app)/invoice/[id]/paid/+page.svelte delete mode 100644 src/routes/(app)/invoice/[id]/tip/+page.server.js delete mode 100644 src/routes/(app)/invoice/[id]/tip/+page.svelte (limited to 'src/routes/(app)/invoice/[id]') diff --git a/src/routes/(app)/invoice/[id]/+layout.server.js b/src/routes/(app)/invoice/[id]/+layout.server.js deleted file mode 100644 index 78d8481e..00000000 --- a/src/routes/(app)/invoice/[id]/+layout.server.js +++ /dev/null @@ -1,19 +0,0 @@ -import Qr from 'qrcode-base64'; -import { get } from '$lib/utils'; -import { redirect } from '@sveltejs/kit'; - -export async function load({ depends, params, url }) { - depends('app:invoice'); - - let { id } = params; - let invoice = await get(`/invoice?id=${id}`); - let { amount, received } = invoice; - amount = parseInt(amount); - - let paid = (!amount && received) || (amount > 0 && received >= amount); - if (paid && !url.pathname.endsWith('paid')) throw redirect(307, `/invoice/${id}/paid`); - - let sm = Qr.drawImg(invoice.text, { size: 300 }); - - return { id, invoice, sm, lg: sm }; -} diff --git a/src/routes/(app)/invoice/[id]/+layout.svelte b/src/routes/(app)/invoice/[id]/+layout.svelte deleted file mode 100644 index 4fa864ce..00000000 --- a/src/routes/(app)/invoice/[id]/+layout.svelte +++ /dev/null @@ -1 +0,0 @@ - diff --git a/src/routes/(app)/invoice/[id]/+page.server.js b/src/routes/(app)/invoice/[id]/+page.server.js deleted file mode 100644 index 1068f273..00000000 --- a/src/routes/(app)/invoice/[id]/+page.server.js +++ /dev/null @@ -1,5 +0,0 @@ -import invoice from '$lib/invoice'; - -export const actions = { - default: invoice -}; diff --git a/src/routes/(app)/invoice/[id]/+page.svelte b/src/routes/(app)/invoice/[id]/+page.svelte deleted file mode 100644 index 28ff27c0..00000000 --- a/src/routes/(app)/invoice/[id]/+page.svelte +++ /dev/null @@ -1,158 +0,0 @@ - - - - -
-
- -
- -
- -
- - {#if address} -
{address}
- {/if} - -
- - - {#if user && user.username !== username} - - - - {/if} -
- -
- {#if invoice.tip} -
- {$t('invoice.invoice')} - - {f(amountFiat, currency)} - {`${sat(amount)}`} - -
- -
- {$t('invoice.tip')} - {f(tipAmount, currency)} - {`${sat(tip)}`} - -
- {/if} - - {#if amount > 0} -
- {$t('invoice.total')} - {f(amountFiat + parseFloat(tipAmount), currency)} - {`${sat(tip + amount)}`} -
- {/if} -
-
- - diff --git a/src/routes/(app)/invoice/[id]/paid/+page.svelte b/src/routes/(app)/invoice/[id]/paid/+page.svelte deleted file mode 100644 index 2ccbc971..00000000 --- a/src/routes/(app)/invoice/[id]/paid/+page.svelte +++ /dev/null @@ -1,62 +0,0 @@ - - -
-
- -
- {#if received} -

{$t('invoice.paymentSuccessful')}

-

- {f(amountFiat, currency)} - {#if tip} - + {f(tipFiat, currency)} - {/if} -

-

- {sat(received - tip)} - {#if tip} - +{sat(tip)} - {/if} -

- {/if} - - {#if pending} -

Payment detected

-

- {f(pendingFiat, currency)} - {#if tip} - + {f(tipFiat, currency)} - {/if} -

-

- {sat(pending - tip)} - {#if tip} - +{sat(tip)} - {/if} -

- {/if} -
- - -
- - -
{$t('payments.tapAnywhere')}
diff --git a/src/routes/(app)/invoice/[id]/tip/+page.server.js b/src/routes/(app)/invoice/[id]/tip/+page.server.js deleted file mode 100644 index c78e5020..00000000 --- a/src/routes/(app)/invoice/[id]/tip/+page.server.js +++ /dev/null @@ -1,11 +0,0 @@ -import invoice from '$lib/invoice'; -import { redirect } from '@sveltejs/kit'; - -export async function load({ parent }) { - let { invoice } = await parent(); - if (!invoice.amount) throw redirect(307, `/invoice/${invoice.id}`); -} - -export const actions = { - default: invoice -}; diff --git a/src/routes/(app)/invoice/[id]/tip/+page.svelte b/src/routes/(app)/invoice/[id]/tip/+page.svelte deleted file mode 100644 index 308720ab..00000000 --- a/src/routes/(app)/invoice/[id]/tip/+page.svelte +++ /dev/null @@ -1,252 +0,0 @@ - - - - -
-
- - - - - - - - -

{$t('invoice.addTipq')}

- {#if !showCustomAmount} -
{Math.round(tipPercent)}%
- - - -
-
- - {f(amountFiat, currency)} - +{f(tipAmount, currency)} - -
- -
- {sat(amount)} - +{sat(tip)} -
-
- - {#if tip} -
- - -
- {:else} - {#each tipAmounts as amount} - - {/each} - {/if} - -
- -
- {/if} - -
-
- - {/if} -
- - -- cgit v1.2.3